package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WxAppletUserMapper;
import com.ruoyi.system.domain.WxAppletUser;
import com.ruoyi.system.service.IWxAppletUserService;

/**
 * 微信用户Service业务层处理
 * 
 * @author chy
 * @date 2022-05-24
 */
@Service
public class WxAppletUserServiceImpl implements IWxAppletUserService 
{
    @Autowired
    private WxAppletUserMapper wxAppletUserMapper;

    /**
     * 查询微信用户
     * 
     * @param id 微信用户主键
     * @return 微信用户
     */
    @Override
    public WxAppletUser selectWxAppletUserById(Long id)
    {
        return wxAppletUserMapper.selectWxAppletUserById(id);
    }

    /**
     * 查询微信用户列表
     * 
     * @param wxAppletUser 微信用户
     * @return 微信用户
     */
    @Override
    public List<WxAppletUser> selectWxAppletUserList(WxAppletUser wxAppletUser)
    {
        return wxAppletUserMapper.selectWxAppletUserList(wxAppletUser);
    }

    /**
     * 新增微信用户
     * 
     * @param wxAppletUser 微信用户
     * @return 结果
     */
    @Override
    public int insertWxAppletUser(WxAppletUser wxAppletUser)
    {
        return wxAppletUserMapper.insertWxAppletUser(wxAppletUser);
    }

    /**
     * 修改微信用户
     * 
     * @param wxAppletUser 微信用户
     * @return 结果
     */
    @Override
    public int updateWxAppletUser(WxAppletUser wxAppletUser)
    {
        wxAppletUser.setUpdateTime(DateUtils.getNowDate());
        return wxAppletUserMapper.updateWxAppletUser(wxAppletUser);
    }

    /**
     * 批量删除微信用户
     * 
     * @param ids 需要删除的微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWxAppletUserByIds(Long[] ids)
    {
        return wxAppletUserMapper.deleteWxAppletUserByIds(ids);
    }

    /**
     * 删除微信用户信息
     * 
     * @param id 微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWxAppletUserById(Long id)
    {
        return wxAppletUserMapper.deleteWxAppletUserById(id);
    }

    @Override
    public WxAppletUser selectWxAppletUserByOpenId(String openId) {
        return wxAppletUserMapper.selectWxAppletUserByOpenId(openId);
    }
}
